package com.food.user.controller;


import com.food.user.commos.Result;
import com.food.user.entity.ProductsType;
import com.food.user.service.ProductsTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 帅得一
 * @since 2023年06月17日
 */
@RestController
@RequestMapping("/productsType")
@Api(tags = "食物类别接口")
public class ProductsTypeController {
    @Autowired
    private ProductsTypeService productsTypeService;
    @GetMapping("/list")
    @ApiOperation("缓存查询所有类别")
    public Result list(){

       List<ProductsType> productsTypes= productsTypeService.cacheList();
        return Result.success(200,"查询餐品类别成功",productsTypes);
    }
}

